<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>资讯动态</title>
    <meta name="keywords" content="大包科技">
    <meta name="description" content="大包科技">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link type="text/css" rel="stylesheet" href="./static/css/basic.css">
    <link rel="stylesheet" type="text/css" href="./static/css/publish.css">
    <link rel="stylesheet" type="text/css" href="./static/css/dynamicInfo.css">
    <link rel="stylesheet" type="text/css" href="./static/css/pagination.css">
    <script type="text/javascript" src="./static/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="./static/js/common.js"></script>
    <script type="text/javascript" src="./static/js/jquery.pagination.js"></script>
</head>
<body>
<div class="bodyWrap">
    <div class='header'>
        <div class="header-content display_flex space_between align_center">
            <a class="logo-wrapper" href="./index.html">
                <img class="logo" src="./static/images/logo.png" alt="logo">
            </a>
            <div class="header-nav display_flex space_between">
                <a href="index.html">首&nbsp;&nbsp;页</a>
                <a href="production.html">产品与服务</a>
                <a href="solution.html">解决方案</a>
                <a href="dynamicInfo.html" class="dynamicInfo active">资讯动态</a>
                <a href="aboutUs.html" class="aboutUs">关于大包</a>
                <a href="contactUs.html">联系我们</a>
            </div>
            <div class="nav-list" id="aboutUs">
                <a href="aboutUs.html?index=0">公司简介</a>
                <a href="aboutUs.html?index=1">公司愿景</a>
                <a href="aboutUs.html?index=2">招贤纳士</a>
                <a href="aboutUs.html?index=3">JOB意义</a>
            </div>
            <div class="nav-list" id="dynamicInfo">
                <a href="dynamicInfo.html?index=0">行业动态</a>
                <a href="dynamicInfo.html?index=1">政策法规</a>
            </div>
        </div>
    </div>
    <div class="wrapimg">
        <img src="static/images/new1.png" >
    </div>
    <div class="dynamic">
        <div class="dynamicLeft">
            <div class="dynamicltop">
                <span>资讯动态</span>
                <p>Information Dynamics</p>
                <div class="react">
                    <span><i></i></span>
                </div>
            </div>
            <div class="dynamiclbottom">
                <ul class="dynamicul">
                    <li class=hangyedongtai>行业动态</li>
                    <li class="zhengcefagui">政策法规</li>
                </ul>
                <div class="newhot">
                    <span class="newhottitle">今日热点</span>
                </div>
            </div>
        </div>
        <div class="dynamicRight">
            <div class="hangye">
                <span class="hangyeTitle">行业动态</span>
                <span> <a href="index.html">首页</a> > 行业动态</span>
            </div>
            <div class="hangyeContent">
            </div>
            <div class="paginations m-style"></div>
            <div class="big">
                <span class="bigTitle"></span>
                <p class="publishtime"><span>来源：</span></p>
                <div class="bigartcile">
                    <span></span>
                </div>
            </div>
            <div class="hangyeDetail"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div id="footer">
        <iframe class="display_block" id="footerBox" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0
                SCROLLING=no src='./foot.htm' width="100%"></iframe>
    </div>
</div>
<script src="static/js/common.js"></script>
<script type="text/javascript">
    $(function () {
      // 获取行业资讯列表
        var positionList = []
        var pageNo = 1;
        var pageSize = 6
      function getList(type) {
          var type = type

          var html = ''
        appAjax({
          url: '/qs/information/page',
          method: 'get',
          data: {
            pageSize: pageSize,
            pageNo: pageNo,
            type: type,
            orderBy: '',
            isAsc: ''
          },
          success: function (res, index) {
              $('.paginations').pagination({
                  pageCount: res.pages,
                  coping: true,
                  jump: true,
                  current: pageNo,
                  homePage: '首页',
                  endPage: '末页',
                  prevContent: '上一页',
                  nextContent: '下一页',
                  callback: function (con) {
                      pageNo = con.getCurrent();
                      getList(type);
                  }
              });
              positionList = res.records;
              getlistData()
          },
          error: function (res2) {
          }
        })
      }
      function getlistData(){
          $(".hangyeContent").empty()
          var html = ''
          positionList.forEach(function (value) {
              var imgsrc = value.name
              if(value.image){
                  imgsrc = value.image
              } else {
                  imgsrc = './static/images/logo.png'
              }
              html += '<div class="hangye-item" data-id="' + value.id + '">';
              html += '<img  src="' + imgsrc + '" width="160px;" height="90" >';
              html += '<div class="itemInroduce">';
              html += '<span class="itemTitle">' + value.title + '</span>'
              html += '<div class="row backrow">'
              html += '<p class="itemArt"> ' + value.description + '</p>';
              html += '</div>';
              html += '<span class="time">' + value.updateTime.substring(0, 10) + '</span>';
              html += '</div>';
              html += '</div>'
          })
          $(".hangyeContent").append(html);
          $(".hangye-item").click(function () {
              $('.big').css('display', 'block')
              $('.paginations').css('display', 'none')
              var that = $(this);
              var id =that.data("id");
              appAjax({
                  url: '/qs/information/detail/' + id,
                  met: 'get',
                  data: {},
                  success: function (childres) {
                      $(".hangyeContent").empty()
                      $('.bigTitle').text(childres.title)
                      $('.publishtime').text("发布时间："+ childres.createTime)
                      $('.publishtime p').text("来源：" + childres.source)
                      $('.bigartcile  span').html(childres.article)
                  }
              })
          })
      }
      $('.hangyedongtai').on('click', function () {
          $(".hangyeContent").empty()
          $('.big').css('display', 'none')
          getList(1)

      })
        $('.zhengcefagui').on('click', function () {
            $('.big').css('display', 'none')
            $(".hangyeContent").empty()
            getList(2)
        })
        getList(1)
        // 获取今日热点列表
        function gethotlist() {
          var hothtml = ''
            appAjax({
                url: 'http://www.xmdabao.com:8080/qs/information/page',
                method: 'get',
                data: {
                    pageSize: 5,
                    pageNo: 1,
                    type: 3,
                    orderBy: 'create_time',
                    isAsc: false
                },

                success: function (res, index) {
                    $.each(res.records, function (index,hotvalue) {
                        hothtml+='<div class="newhot-item"  data-id="'+hotvalue.id+'">'
                        hothtml+='<div class="hotcontent" >';
                        hothtml+='<span>'+ hotvalue.title + '</span>';
                        hothtml+='<span class="time">'+ hotvalue.createTime.substring(0,10) + '</span>'
                        hothtml+='</div>';
                        hothtml+='</div>';
                    })
                    $(".newhot").append(hothtml);
                    $(".newhot-item").click(function () {
                        $('.big').css('display', 'block')
                        $('.paginations').css('display', 'none')
                        var that = $(this);
                        var id =that.data("id");
                        appAjax({
                            url: '/qs/information/detail/' + id,
                            met: 'get',
                            data: {},
                            success: function (childres) {
                                $(".hangyeContent").empty()
                                $('.bigTitle').text(childres.title)
                                $('.publishtime').text("发布时间："+childres.createTime)
                                $('.publishtime p').text("来源：" + childres.source)
                                $('.bigartcile  span').html(childres.article)
                            }
                        })
                    })
                },
                error: function (res2) {
                }
            })
        }
        gethotlist()
        var index = getUrlParam('index') ? getUrlParam('index') : 0;
        $(".dynamicul li").eq(index).addClass('active').siblings().removeClass('active');
        $(".dynamicul li").click(function () {
            var index = $(this).index();
            $('.newhot .newhot-item .hotcontent ').removeClass('active imgactive')
            $(".dynamicul li").eq(index).addClass('active').siblings().removeClass('active');;
        });
        $('.newhot ').on('click', '.newhot-item ', function () {
            $('.newhot .newhot-item .hotcontent ').removeClass('active imgactive')
            $(this).children('.hotcontent').addClass('active imgactive');
            $(".dynamicul li").removeClass('active');
        })
    })
</script>
</body>
</html>
